import request from '@/utils/system/request'


/** 登录api */
export function loginApi(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
// 获取所有评论
export function commentPage(data) {
  return request({
    url: '/comment/page',
    method: 'post',
    data
  })
}
// 添加或修改评论
export function commentSaveOrUpdate(data) {
  return request({
    url: '/comment/saveOrUpdate',
    method: 'post',
    data
  })
}

// 删除评论
export function commentDel (data) {
  return request({
    url: `/comment/del?id=${data.id}`,
  })
}

//获取聊天常用语
export function contList(data) {
  return request({
    url: `/content/list?adCode=${data.adCode}`,
    method: 'get',
  })
}
//添加修改常用语
export function saveOrUpdate(data) {
  return request({
    url: '/content/saveOrUpdate',
    method: 'post',
    data
  })
}
//删除常用语
export function chatDel(data) {
  return request({
    url: `/content/del?id=${data.id}`,
    method: 'get',
  })
}
// 数据字典
export function apiDict(data) {
  return request({
    method: "Post",
    url: `/dict/page`,
    data,
  })
}
// 数据字典不分页
export function dict(data) {
  return request({
    method: "Get",
    url: `/dict?code=${data.code}`,
  })
}

//添加常用语
export function addApiDict(data) {
  return request({
    method: "Post",
    url: `/dict/saveOrUpdate`,
    data,
  })
}
//删除字典数据
export function dictDel(data) {
  return request({
    url: `/dict/del?id=${data.id}`,
    method: 'get',
  })
}

//获取卡列表
export function adList(data) {
  return request({
      url: '/ad/list',
      method: 'post',
      data
  })
}
//修改卡信息
export function adModify(data) {
  return request({
      url: '/ad/modify',
      method: 'post',
      data
  })
}
// 创建卡信息
export function adAdd(data) {
  return request({
      url: '/ad/add',
      method: 'post',
      data
  })
}
//删除广告信息
export function cardDel(data) {
  return request({
    url: `/card/del?id=${data.id}`,
    method: 'get',
  })
}
// 查询规则列表
export function rulesList(data) {
  return request({
    url: `/rules/list?keyword=${data?data.keyword:''}`,
    method: 'get',
  })
}
// 查询规则详情
export function rulesDetail(data) {
  return request({
    url: `/rules/detail?id=${data.id}`,
    method: 'get',
  })
}
//添加规则
export function rulesAdd(data) {
  return request({
      url: '/rules/add',
      method: 'post',
      data
  })
}
//修改规则
export function rulesModify(data) {
  return request({
      url: '/rules/modify',
      method: 'post',
      data
  })
}
//获取收分费率
export function pointsList(data) {
  return request({
    method: "GET",
    url: `/ads/pts/rate`,
  })
}

// 获取用户列表
export function userList(data) {
  return request({
    url: `/user/page`,
    method: 'post',
    data
  })
}





